#include <Arduino.h>
#include "FlashingLed.h"

FlashingLed::FlashingLed(int pin, boolean verbose) {
  _verbose = verbose;
  _pin = pin;
  pinMode(_pin, OUTPUT);
  _state = HIGH;
  digitalWrite(_pin, _state);
  if(_verbose) {
    Serial.begin(9600);
  }
}


void FlashingLed::flash() {
  _state = !_state;
  digitalWrite(_pin, _state);
  if(_verbose) {
    Serial.print("FlashingLed on pin "); 
    Serial.print(_pin, HEX); 
    Serial.print(" is "); 
    Serial.println(_state ? "ON" : "OFF"); 
  }
}
